<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                >
    <h:form>
        <h:outputText value="Logged in as:${authSessionBean.loggedInUser.userName}"/>
    </h:form>
    <h:form>
        <h:link outcome="dunes.jsf" value="Start"/>
    </h:form>
    <c:if test="${authSessionBean.loggedInUser ==null}">
        <h:form>
            <h:link outcome="login.jsf" value="Login"/>
        </h:form>
    </c:if>
    

    <c:if test="${authSessionBean.loggedInUser ==null}">
        <h:form>
            <h:link outcome="register.jsf" value="Register" />
        </h:form>
    </c:if>

    <c:if test="${authSessionBean.loggedInUser !=null}">
        <h:form>
            <h:commandLink action="${loginControllerBean.doLogout}" value="Logout"/>
        </h:form>
    </c:if>

    <c:if test="${authSessionBean.postAuth}" >
        <h:form>
            <h:link outcome="newPost.jsf" value="Make new post"/>
        </h:form>
    </c:if>

    <c:if test="${authSessionBean.adminAuth}" >
        <h:form>
            <h:link outcome="adminCtrl.jsf" value="Admin controls"/>
        </h:form>
    </c:if>

</ui:composition>

